Perform an action if a condition is true¶
Perform an action if a condition is true.
Given a variable name, if the value is 1, display the string “First day
of a Month!” and do nothing if the value is not equal.
n = 1
if n == 1:
print("First day of a month")
print()
Output:
First day of a month